﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web.Routing;

namespace Infrastructure.Web.Extensions
{
    public class HtmlHelper
    {
        public static string RouteHyperlink(Func<string> target, string text, RouteValueDictionary values = null)
        {
            var vp = RouteTable.Routes.GetVirtualPath(null, target.Invoke(), values).VirtualPath;            
            return "<a href='" + vp + "'>" + text + "</a>" ;
        }
    }
}
